# 1.筛选列表中小于零的数--------------------------------
list_my = [1, 6, -8, -5, 2, -8, 7, 9]
# 方法1
list_new = [i for i in list_my if i < 0]
print(list_new)
# 方法2
list_new = list(filter(lambda x: x < 0, list_my))
print(list_new)
# --------------------------------------------------
# 2.筛选字典中值高于90的项目
dict_my = {'lilei': 34, 'wangfei': 94, 'fengtian': 88}
# 方法1
dict_new = {k: v for k, v in dict_my.items() if v > 90}
print(dict_new)
# --------------------------------------------------

